//
// CHLSColorTexture.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.IStream;

public class CHLSColorTexture {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CHLSColorTexture(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CHLSColorTexture obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CHLSColorTexture(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CHLSColorTexture() {
    this(nel3dJNI.new_CHLSColorTexture(), true);
  }

  public void reset() {
    nel3dJNI.CHLSColorTexture_reset(swigCPtr, this);
  }

  public void setBitmap(SWIGTYPE_p_NLMISC__CBitmap bmp) {
    nel3dJNI.CHLSColorTexture_setBitmap(swigCPtr, this, SWIGTYPE_p_NLMISC__CBitmap.getCPtr(bmp));
  }

  public void addMask(SWIGTYPE_p_NLMISC__CBitmap bmp, long threshold) {
    nel3dJNI.CHLSColorTexture_addMask__SWIG_0(swigCPtr, this, SWIGTYPE_p_NLMISC__CBitmap.getCPtr(bmp), threshold);
  }

  public void addMask(SWIGTYPE_p_NLMISC__CBitmap bmp) {
    nel3dJNI.CHLSColorTexture_addMask__SWIG_1(swigCPtr, this, SWIGTYPE_p_NLMISC__CBitmap.getCPtr(bmp));
  }

  public long getNumMasks() {
    return nel3dJNI.CHLSColorTexture_getNumMasks(swigCPtr, this);
  }

  public void buildColorVersion(CHLSColorDelta colDeltaList, SWIGTYPE_p_NLMISC__CBitmap out) {
    nel3dJNI.CHLSColorTexture_buildColorVersion(swigCPtr, this, CHLSColorDelta.getCPtr(colDeltaList), colDeltaList, SWIGTYPE_p_NLMISC__CBitmap.getCPtr(out));
  }

  public void serial(IStream f) {
    nel3dJNI.CHLSColorTexture_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public static void compressBlockRGB(CRGBA srcRGBA, SWIGTYPE_p_unsigned_char dstDXTC) {
    nel3dJNI.CHLSColorTexture_compressBlockRGB(CRGBA.getCPtr(srcRGBA), srcRGBA, SWIGTYPE_p_unsigned_char.getCPtr(dstDXTC));
  }

}
